﻿using AutoMapper;
using Domain;
using Domain.BOM;
using Domain.DTOs;
using Domain.DTOs.BOMs;
using Domain.DTOs.Equipmentes;
using Domain.DTOs.Order;
using Domain.DTOs.Quality;
using Domain.DTOs.ProcessSteps;
using Domain.DTOs.Warehouse;
using Domain.Quality;
using Domain.Warehousies;
using Domain.工艺工序;
using Domain.生产订单;
using Team.API.Applocation.Command;
using Team.API.Applocation.Command.Equipment;
using Team.API.Applocation.Command.Order;
using Team.API.Applocation.Command.Quality;
using Team.API.Applocation.Command.Makesteps;
using Team.API.Applocation.Command.Warehouse.laneway;



namespace Team.API
{
    /// <summary>
    /// 映射文件
    /// </summary>
    public class AutomapperFiles : Profile
    {
        public AutomapperFiles()
        {

            // BOM树形显示 和获取BOM成品详情
            CreateMap<Bomtable, BOMDTO>();
            // BOM物料列表
            CreateMap<Bomtable, BOMListDTO>();
            // BOM成品日志
            CreateMap<Nlogmodel, OneNlogDTO>();
            // BOM操作日志列表
            CreateMap<Nlogmodel, BOMLogDTO>();
             
            CreateMap<CreateEquipmentCommand, Equipmentmodel>();
            CreateMap<UpdateEquipmentCommand, Equipmentmodel>();
            CreateMap<Equipmentmodel, EquipmentDTO>();
            CreateMap<QualityDto, Qualitymodel>();
            CreateMap<Qualitymodel, QualityListDto>();

            CreateMap<CreateMakestepCommand, Makestepmodel>();
            CreateMap<Makestepmodel, MakestepListDTO>();
            CreateMap<Makestepmodel, MakestepDetailDTO>();
            CreateMap<Makestepmodel, MakestepTreeDTO>();
            CreateMap<Nlogmodel, MakestepLogDTO>();

            // Order映射
            CreateMap<CreateOrderCommand, OrderModel>();
            CreateMap<UpdateOrderCommand, OrderModel>();
            CreateMap<OrderModel, OrderDTO>()
                .ForMember(dest => dest.Itemname, opt => opt.Ignore())
                .ForMember(dest => dest.OrderstatusText, opt => opt.Ignore());

            // Laneway映射
            CreateMap<CreateLanewayCommand, Lanewaymodel>();
            CreateMap<UpdateLanewayCommand, Lanewaymodel>();
            CreateMap<Lanewaymodel, LanewayDTO>();
        }
    }
}
